package com.qianya.system.manage.web.login.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

public interface CustomMapper extends BaseMapper {

    @Insert("insert into login_users_dept(u_id,dept_id) values (#{uuid},#{deptId})")
    int saveUserDept(@Param("uuid") String uuid, @Param("deptId") String deptId);

    @Insert("insert into login_users_role(U_ID,RO_ID) values (#{uuid},#{roleId})")
    int saveUserRole(@Param("uuid")String uuid, @Param("roleId")String roleId);

    @Delete("delete from login_users_dept where u_id=#{uuId}")
    int deleteUserDept(@Param("uuId")String uuId);

    @Delete("delete from login_users_role where u_id=#{uuId}")
    int deleteUserRole(@Param("uuId")String uuId);

    @Insert("insert into login_users_role_permission(R_RO_ID,R_P_ID) values (#{roId},#{permissionId})")
    int saveRolePermission(@Param("roId") String roId, @Param("permissionId") String permissionId);

    @Delete("delete from login_users_role_permission where R_RO_ID=#{roId}")
    int deleteRolePermission(@Param("roId") String roId);


}
